﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Dotway.WPF.Samples.DotwaySampleApplication
{
    /// <summary>
    /// Interaction logic for ZipperPanelSample.xaml
    /// </summary>
    public partial class ZipperPanelSample : UserControl
    {
        public ZipperPanelSample()
        {
            InitializeComponent();
        }

        private Random random = new Random();

        private void AddButtonClick(object sender, RoutedEventArgs e)
        {
            Border border = new Border();
            border.Width = 60;
            border.Height = 40;
            border.Background = new SolidColorBrush(Color.FromRgb((byte)random.Next(255), (byte)random.Next(255), (byte)random.Next(255)));
            border.BorderThickness = new Thickness(1);
            border.BorderBrush = Brushes.Black;

            zipperPanel.Children.Add(border);
        }

        private void RemoveButtonClick(object sender, RoutedEventArgs e)
        {
            if (zipperPanel.Children.Count > 0)
            {
                zipperPanel.Children.RemoveAt(0);
            }
        }
    }
}
